package com.boom.config;

import com.boom.interceptor.SysInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class WebConfigurer implements WebMvcConfigurer {

    @Resource
    private SysInterceptor sysInterceptor;

    //配置静态文件，比如HTML，JS，CSS等等
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry){


    }


    //注册拦截器
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(sysInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**","/login","/dologin.html","/user/list.html","/swagger-ui.html","/usermodify.html","/ucexist.html","/usermodify.html","/usermodifysave.html","/deluser","/provider/**","/bill/**","/statics/**");

    }
}
